<%@page import="cn.yunhe.biz.NewsBizImpl"%>
<%@page import="cn.yunhe.biz.INewsBiz"%>
<%@page import="cn.yunhe.model.News"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<h2><a href="addNews.jsp">添加新闻</a></h2>
	
	<table>
		<tr>
			<th>编号</th>
			<th>标题</th>
			<th>发布时间</th>
			<th>发布人</th>
			<th>所属板块</th>
		</tr>
		<%
			List<News> newslist=(List<News>)request.getAttribute("newslist");
			
			if(newslist==null){
				INewsBiz newBiz=new NewsBizImpl();
				newslist=newBiz.getALLnew();
				
			}
		
			for(int i=0;i<newslist.size();i++){
				News news=newslist.get(i);
		%>
		<tr>
			<td><%=news.getNewsId() %></td>
			<td><a href="newsdetail.jsp?nid=<%=news.getNewsId()%>"><%=news.getTitle()%></a></td>
			<td><%=news.getWriteDate() %></td>
			<td><%=news.getAdmin().getAdminName() %></td>
			<td><%=news.getCate().getCateName() %></td>
		</tr>
		<%
			}
		%>
	
	</table>
</body>
</html>